﻿<%@ Page Language="VB" MasterPageFile="~/HelpDesk.master" AutoEventWireup="false"
    CodeFile="Clients.aspx.vb" Inherits="Admin_Clients" Title="Gestion clients" Theme="HelpDesk"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1>
        <asp:Localize ID="Localize1" runat="server" meta:resourcekey="LabelPageTitle1"></asp:Localize>
    </h1>
    <table width="100%">
        <tr>
            <td width="50%">
                <asp:HyperLink ID="LienNouveauClient" runat="server" NavigateUrl="~/Admin/ClientsForm.aspx"
                    meta:resourcekey="LienNouveauClientResource1">
                    <img src="../Images/Icones/vcard_add.png" alt="Nouveau client" />
                    Nouveau client      
                </asp:HyperLink>
            </td>
            <td align="right" width="50%">
                <asp:TextBox ID="TextBoxFiltre" runat="server" Columns="25" meta:resourcekey="TextBoxFiltreResource1"></asp:TextBox>
                <asp:Button ID="BoutonFiltre" runat="server" Text="Filtrer" meta:resourcekey="BoutonFiltreResource1" /></td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlEntreprises" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
        SelectCommand="SELECT entreprise_id, entreprise_nom, entreprise_adresse, entreprise_tel, entreprise_fax, entreprise_mail FROM Entreprise WHERE (entreprise_nom LIKE CASE WHEN @nom IS NULL THEN entreprise_nom ELSE @nom + '%' END) ORDER BY entreprise_nom"
        CancelSelectOnNullParameter="False">
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBoxFiltre" Name="nom" PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridViewEntreprises" runat="server" AllowPaging="True" AutoGenerateColumns="False"
        DataKeyNames="entreprise_id" DataSourceID="SqlEntreprises" PageSize="20" meta:resourcekey="GridViewEntreprisesResource1">
        <Columns>
            <asp:TemplateField meta:resourcekey="TemplateFieldResource1">
                <ItemTemplate>
                    <asp:HyperLink ID="LienModifClient" runat="server" NavigateUrl='<%# Eval("entreprise_id", "ClientsForm.aspx?entreprise_id={0}") %>'
                        meta:resourcekey="LienModifClientResource1">
                        <img src="../Images/Icones/vcard_edit.png" alt="Modifier client" />
                    </asp:HyperLink>
                </ItemTemplate>
                <ItemStyle Width="16px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Nom" SortExpression="entreprise_nom" meta:resourcekey="TemplateFieldResource2">
                <ItemTemplate>
                    <asp:HyperLink ID="LienModifClient" runat="server" NavigateUrl='<%# Eval("entreprise_id", "ClientsForm.aspx?entreprise_id={0}") %>'
                        Text='<%# Bind("entreprise_nom") %>' meta:resourcekey="LienModifClientResource2"></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle Width="45%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Coordonn&#233;es" SortExpression="entreprise_adresse"
                meta:resourcekey="TemplateFieldResource3">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("entreprise_adresse", "{0}<br/>") %>'
                        meta:resourcekey="Label1Resource1"></asp:Label>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("entreprise_tel", "Tel : {0}<br/>") %>'
                        meta:resourcekey="Label2Resource1"></asp:Label>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("entreprise_fax", "Fax : {0}<br/>") %>'
                        meta:resourcekey="Label3Resource1"></asp:Label>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("entreprise_mail", "mailto:{0}") %>'
                        Text='<%# Eval("entreprise_mail") %>' meta:resourcekey="HyperLink1Resource1"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
